{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% import "_macros.html" as macros %}

{% block title %}语音识别模型基准测试系统{% endblock %}

{% block page_content %}
<div class="page-header">
    <p>基准测试任务<a href="{{ url_for('.btt',id=bttask.id) }}">{{ bttask.name }}</a>目前共有{{ btexecs.total }}条运行历史</p>
    {% if btexecs.first==0 %}
    <p>没有基准测试任务运行历史信息</p>
    {% else %}
    <div class="row">
        <table class="table">
            <thead>
                <tr>
                    <th>名称</th>
                    <th>采集的指标</th>
                    <th>任务状态</th>
                    <th>运行的开始时间</th>
                    <th>对应的celery任务id</th>
                    <th>测试任务日志</th>
                    <th>基准测试结果</th>
                </tr>
            </thead>
            <tbody>
                {% for i in range(btexecs.items|length) %}
                <tr>
                    <td><a href="{{ url_for('.get_measure_tags',measurement=btexecs.items[i].name) }}">{{ btexecs.items[i].name }}</a></td>
                    <td>{{ metric_names[i] }}</td>
                    <td>{{ status_list[btexecs.items[i].result_status] }}</td>
                    <td>{{ btexecs.items[i].start_time }}</td>
                    <td>{{ btexecs.items[i].celery_task_id }}</td>
                    <td><a href="{{ url_for('.bttask_log',btexec_id=btexecs.items[i].id) }}">查看</a></td>
                    <td>{% if btexecs.items[i].result_status in [3,4,5,7] %}<a href="{{ url_for('.btresults',btexec_id=btexecs.items[i].id) }}">查看</a>{% else %}暂时没有结果{% endif %}</td>
                </tr>
                {% endfor %}
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="4">
                        <ul class="pagination">
                            {% for i in page_range %}
                            {% if i==btexecs.page %}
                            <li class="active"><a href="/btexec_history?page={{ i }}&per_page={{ per_page }}">{{ i }}</a></li>
                            {% else %}
                            <li><a href="/btexec_history?page={{ i }}&per_page={{ per_page }}">{{ i }}</a></li>
                            {% endif %}
                            {% endfor %}
                        </ul>
                    </td>
                    <td colspan="4" style="vertical-align:bottom">
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">当前每页{{ per_page }}条数据项，更改至每页数据项 <b class="caret"></b></a>
                            <ul class="dropdown-menu">
                                {% for i in [5,10,20,50] %}
                                <li><a href="/btexec_history?page=1&per_page={{ i }}">{{ i }}条</a></li>
                                {% endfor %}
                            </ul>
                        </li>
                    </td>
                </tr>
            </tfoot>
        </table>
    </div>
    {% endif %}
    </div>
    {% endblock %}